﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

using AttributeRouting;
using AttributeRouting.Web.Mvc;
using Phatent.Model.Pages;
using Phatent.Logic.Pages;
namespace Phatent.Website.Areas.Home.Controllers
{
    [RouteArea("Home")]
    [RoutePrefix("News")]
    public class NewsController : Controller
    {
        [Route("")]
        [Route("Corperation")]
        public ActionResult Corperation()
        {
            var tops = PageLogic.Gets(new PageQuery() { CaseID = 9, PageSize = 3, PageIndex = 0, Visible=true });
            return View(tops);
        }

        [Route("Technology")]
        public ActionResult Technology()
        {
            return View();
        }

        [Route("Message")]
        [Route("InvestContact")]
        public ActionResult Message()
        {
            var cas = CaseLogic.GetCaseByFriendUrl(Request.Path);
            ViewBag.Case = cas;
            return View();
        }

        [Route("MessageResult")]
        public ActionResult MessageResult()
        {
            var message = new MessageModel()
            {
                RealName = Request.Form["realname"],
                Mobile = Request.Form["mobile"],
                Email = Request.Form["email"],
                Description = Request.Form["description"]
            };
            MessageLogic.CreateNewMessage(message);
            return View();
        }
    }
}
